<!-- 商品详情 -->
<template>
      <el-scrollbar height="80vh">
        <center>
      <el-card :body-style="{ padding: '20px' }">
                        <img :src="JSON.parse(productInfo).url" class="image" />
                        <div style="padding: 10px">
                            <el-row :gutter="20">
                               
                                <el-col :span="16"><el-text class="title" line-clamp="1"  truncated> </el-text></el-col>

                                <el-col :span="8" class="price"><el-text class="w-100px mb-1" type="danger" size="small"
                                        truncated>
                                        {{ JSON.parse(productInfo).price }}
                                    </el-text></el-col>

                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="18"><el-text class="desc" line-clamp="3" truncated>
                                        {{ JSON.parse(productInfo).description }}
                                    </el-text></el-col>
                                <el-col :span="6">
                                    <router-link :to="{ name: 'succcess', params: { info: productInfo}}">
                                    <el-button text class="button"
                                        >加入购物车</el-button>
                                    </router-link>
                                    </el-col>
                                        
                            </el-row>   



                        </div>
                    </el-card>
                </center>
    </el-scrollbar>
</template>

<script>

export default {
    name:'detail',
    props: ['productInfo'],
    data() {
        return {
           value:'',
           type:1
        }
    },
    onAddItem(productInfo) {
        let that = this
            that.$router.push({name:"succcess",params:{info:productInfo}})
            ElNotification({
                title: '添加购物车成功',
                message: '添加'+name+'到购物车成功',
                type: 'success',
            })
        },
}
</script>